import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    redirect: (to) => {
      return { name: "HomePage" };
    },
    component: HomeView,
    children:[
      {
        path: 'home-page',
        name: 'HomePage',
        component: () => import( '../views/page/HomePage.vue')
      },
      {
        path: 'my-concern',
        name: 'Concern',
        component: () => import( '../views/page/MyConcern.vue')
      },
      {
        path: 'my-Account',
        name: 'Account',
        component: () => import( '../views/page/MyAccount.vue')
      },
      {
        path: 'cloud-village',
        name: 'Village',
        component: () => import( '../views/page/CloudVillage.vue')
      },
      {
        path: 'search-music',
        name: 'Search',
        component: () => import( '../views/page/SearchMusic.vue')
      }
    ]
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
